/**
 * This class is the main view for the application. It is specified in app.js as
 * the "autoCreateViewport" property. That setting automatically applies the
 * "viewport" plugin to promote that instance of this class to the body element.
 * 
 * TODO - Replace this content of this view to suite the needs of your
 * application.
 */
Ext.define('app.main.Main', {
    extend: 'Ext.container.Container',

    xtype: 'app-main',
    requires: ['app.main.MainController', 'app.main.MainModel'],
    uses: ['app.main.region.Center', 'app.main.region.Top',
            'app.main.region.Bottom', 'app.main.region.Left'],

    controller: 'main',
    viewModel: {
        type: 'main'
    },

    initComponent: function () {
        Ext.setGlyphFontFamily('FontAwesome'); // 设置图标字体文件，只有设置了以后才能用glyph属性
        this.callParent();
    },

    layout: {
        type: 'border' // 系统的主页面的布局
    },

    listeners: {
        resize: function (container) {
            container.getController().onMainResize();
        }
    },
    items: [{
        xtype: 'maintop',
        region: 'north'
    }, {
        xtype: 'mainbottom',
        region: 'south'
    }, {
        xtype: 'mianleft',
        region: 'west'
    }, {
        region: 'center',
        xtype: 'maincenter'
    }]
});
